/*
 * teacherCenter.js
 */
var isIE = navigator.appName.indexOf("Internet Explorer") != -1;

var teacherLiList = [];
var teacherContentList = [];
var teacherLiListStr = "teacherProfileLi,teacher2studentsLi,exchangeTeacherTimeLi,teacherCommentsLi,teacherExchangeRecordLi"; 
var teacherContentListStr = "teacherProfile,teacher2students,exchangeTeacherTime,teacherComments,teacherExchangeRecord"; 

$(document).ready(function(){
	if(isIE){
		$("#teacherInfoPanel input").attr("unselectable", "on");
	}else{
		$("#teacherInfoPanel input").attr("disabled","disabled");
	}
	teacherLiList = teacherLiListStr.split(",");
	teacherContentList = teacherContentListStr.split(",");
 });

function editTeacherProfile(){
	
	if(isIE){
		$("#teacherInfoPanel input").attr("unselectable", "off");
	}else{
		$("#teacherInfoPanel input").removeAttr("disabled");
	}
	
	$("#teacherInfoPanel input").css("border-width","1px");
	$("#editTeacherProfile").css("display", "none");
	$("#saveTeacherProfile").css("display", "block");
	$("#cancelTeacherProfile").css("display", "block");
}

function saveTeacherProfile(){
	
	if(isIE){
		$("#teacherInfoPanel input").attr("unselectable", "on");
	}else{
		$("#teacherInfoPanel input").attr("disabled","disabled");
	}
	
	$("#teacherInfoPanel input").css("border-width","0px");
	$("#editTeacherProfile").css("display", "block");
	$("#saveTeacherProfile").css("display", "none");
	$("#cancelTeacherProfile").css("display", "none");
}

function cancelTeacherProfile(){

	if(isIE){
		$("#teacherInfoPanel input").attr("unselectable", "on");
	}else{
		$("#teacherInfoPanel input").attr("disabled","disabled");
	}
	$("#teacherInfoPanel input").css("border-width","0px");
	$("#editTeacherProfile").css("display", "block");
	$("#saveTeacherProfile").css("display", "none");
	$("#cancelTeacherProfile").css("display", "none");
}


function teacherCenterOnclick(teacherInfoLi,teacherInfoContent){
	var i=0;
	for(i; i<teacherLiList.length; i++){
		$("#" + teacherLiList[i]).removeClass("active");
		$("#" + teacherContentList[i]).addClass("hide");
	}
	$("#" + teacherInfoLi).addClass("active");
	$("#" + teacherInfoContent).removeClass("hide");
}


